How to Prevent to Deny drop permission of a table in SQL Server?
How to Prevent to Deny drop permission of a table for all Users in SQL Server?
I completed my post-graduation in 2013 in the engineering field. Engineering is the application of science and math to solve problems. Engineers figure out how things work and find practical uses for scientific discoveries. Scientists and inventors often get the credit for innovations that advance the human condition, but it is engineers who are instrumental in making those innovations available to the world. I love pet animals such as dogs, cats, etc.
Steilla Mitchel
08-Nov-2021Deny Drop Permission for a Table:
Sometimes cases are generated in that users drop the table from database without informing or by mistake dropped any table then If you want to prevent to drop the table by some user, you can use the following SQL statement ,
The other Deny permission for a user then the following SQL statement is used. First deny the SELECT statement for a particular user.
You also used the following SQL statement for deny the UPDATE table statement for a particular user.
The above SQL statement is used to Deny the drop permission on a particular user.
If you want to restrict on all the user at a time to deny drop permission of all table in your database then you have need to create a DDL Trigger in your database which stop the drop permission of tables. The following SQL statement is used to create a trigger on database to deny the permission,